package com.wzu.rjgc_ks.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author 李敏惠 16219111214
 * @date 2019/6/15 15:34
 */

@Configuration
public class UploadFileConfig extends WebMvcConfigurerAdapter {

    @Value("${file.http.path}")
    String httpPath;
    @Value("${file.save.path}")
    String savePath;


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/imgs/**").addResourceLocations("file:" + savePath);
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
        super.addResourceHandlers(registry);
    }
}
